/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * <p>Project: jse2303 - Exce1
 * <p>Powered by webrx On 2023-07-18 14:42:37
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Exce1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入[a,b]数字：");
        try {
            int a = sc.nextInt();
            int b = sc.nextInt();
            System.out.println(a / b);
            //return;
            System.exit(0);
        } catch (InputMismatchException e) {
            System.out.println("输出错误，请输入整数");
        } catch (ArithmeticException e) {
            System.out.println("除数不能为0");
        } catch (Exception e) {
            System.out.println("程序未知错误");
        } finally {
            //有没有异常都要执行的
            System.out.println("程序退出");
        }
    }
}
